﻿#region  文件信息

// ---------------------------------------------------------------------------------------
// <copyright file="WapYlRequestPlaceOrder.cs" company="">
// 作者：李帅伦
// </copyright>
// <summary>
// 类型简介：
// 类型详细：WapYlRequestPlaceOrder.cs
// 创建时间：2014-12-25 13:01
// 修改时间：2014-12-24 14:27
// </summary>
// ---------------------------------------------------------------------------------------
#endregion

namespace Payment.WapYinlian
{
    /// <summary>
    /// The wap yl request place Service.
    /// </summary>
    public class WapYlRequestPlaceOrder
    {
        #region Public Properties

        /// <summary>
        ///     订单特征码	AN	32	M	订单特征码（年月日 yyyyMMddhhmmss+10 位随机数（数字+字母）
        /// </summary>
        public string ChrCode { get; set; }

        /// <summary>
        ///     MerOrderId	商户订单号	AN	32	M	商户为某笔交易生成的唯一识别号
        /// </summary>
        public string MerOrderId { get; set; }

        /// <summary>
        ///     备用字段	ANS	256	O	备用字段
        /// </summary>
        public string Reserve { get; set; }

        /// <summary>
        ///     响应码	N	8	M
        /// </summary>
        public string RespCode { get; set; }

        /// <summary>
        ///     响应码描述	ANS	128	O
        /// </summary>
        public string RespMsg { get; set; }

        /// <summary>
        ///     签名数据	ANS	256	M	HexStr
        /// </summary>
        public string Signature { get; set; }

        /// <summary>
        ///     交易流水号	AN	32	M	银商订单流水号
        /// </summary>
        public string TransId { get; set; }

        #endregion

        #region Public Methods and Operators

        /// <summary>
        /// 验证签名
        /// </summary>
        /// <param name="wapYlConfig">
        /// The wap Yl Config.
        /// </param>
        /// <returns>
        /// The <see cref="string"/>.
        /// </returns>
        public string GetmerSign(WapYlConfig wapYlConfig)
        {
            var str = this.TransId + this.ChrCode;
            return RsaUtil.RsaSign(str, wapYlConfig.Pvr);
        }

        #endregion
    }
}